#include <iostream>
using namespace std;
#include "DateTime.h"
using namespace flyboy;


int main(){
	/*
	DateTime test(2015, 7, 19);
	test.Adjust(DateTime::AdjustType::ADJUST_DAY, -10000);
	cout << test << endl;

	test.Adjust(DateTime::AdjustType::ADJUST_MONTH, -100);
	cout << test << endl;

	test.Adjust(DateTime::AdjustType::ADJUST_MONTH, 100);
	cout << test << endl;
	test.Adjust(DateTime::AdjustType::ADJUST_YEAR, 100);

	cout << test << endl;

	test.Adjust(DateTime::AdjustType::ADJUST_YEAR, -100);
	cout << test << endl;

	DateTime one(1111, 02, 20);
	DateTime another(222, 12, 21);

	auto ret = one - another;
	cout << FormatTuple(ret);

	ret = another - another;
	cout << FormatTuple(ret) << endl;

	DateTime obj = one + 1234567 + 1234;
	cout << obj << endl;*/

	DateTime time(2000, 1, 1, DateTime::WeekType::WEEK_SATURDAY);
	int begin = 5;
	int input;
	do{
		std::cin >> input;
		if (input == -1){
			return 0;
		}
		cout << (time + input) <<endl;
	} while (1);
	return 0;
}